package edu.nf.test.demo;

import io.github.classgraph.ClassGraph;
import io.github.classgraph.ClassInfo;
import io.github.classgraph.ClassInfoList;
import io.github.classgraph.ScanResult;

/**
 * @author CSY
 * @date 2025 - 04 - 16
 * 扫描文件工具类 - 使用外部引入的包中的ClassGraph
 */
public class ScanUtils {
    public static ClassInfoList scan(String packageName){

        ClassGraph classGraph = new ClassGraph();

        //根据包名获取结果集
        ScanResult result = classGraph.acceptPackages(packageName).scan();

        //获取到所有的类
        return new ClassInfoList(result.getAllClasses());
    }

}
